<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Administraci&oacuten de Lugares</title>
<link rel="stylesheet" href="<c:url value='/css/estilos.css'/>"/>
</head>
<body>
	<header> <jsp:include page="items.jsp"></jsp:include> </header>
<div style="margin: auto; width: 80%;">
<h1 style="width: 100%; text-align: center;">Administraci&oacuten de Lugares</h1>

<c:url var="addUrl" value="/place/add" />

<table style="border: 1px solid; width: 100%; text-align:center">
	<thead style="background:#ff0000; color:#ffffff">
		<tr>
			<th>C&oacute;digo</th>
			<th>Nombre</th>
			<th>Descripci&oacuten</th>
			<th>Aula</th>
			<th>Bloque</th>
			<th>Tipo de Lugar</th>
			<th>Longitud</th>
			<th>Latitud</th>
			<th colspan="2">Opciones</th>
		</tr>
	</thead>
	<tbody>
	<c:forEach items="${placeList}" var="place">
			<c:url var="editUrl" value="/place/edit?id=${place.placeCode}" />
			<c:url var="deleteUrl" value="/place/delete?id=${place.placeCode}" />
		<tr>
			<td><c:out value="${place.placeCode}" /></td>
			<td><c:out value="${place.placeName}" /></td>
			<td><c:out value="${place.placeDescription}" /></td>
			<td><c:out value="${place.room}" /></td>
			<td><c:out value="${place.block}" /></td>
			<td><c:out value="${place.placeTypeDescription}" /></td>
			<td><c:out value="${place.longitude}" /></td>
			<td><c:out value="${place.latitude}" /></td>
			<td><a href="${editUrl}">Editar</a></td>
			<td><a href="${deleteUrl}">Eliminar</a></td>
		</tr>
	</c:forEach>
	</tbody>
</table>

<a href="${addUrl}" style="float: right; margin-top: 20px;">Adicionar Lugar</a>

</div>
</body>
</html>